
package com.shop.cloud.mall.api.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shop.cloud.common.core.constant.CacheConstants;
import com.shop.cloud.mall.common.entity.SeckillHall;
import com.shop.cloud.mall.api.mapper.SeckillHallMapper;
import com.shop.cloud.mall.api.service.SeckillHallService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 秒杀会场
 *
 * @author
 * @date 2020-08-12 16:12:35
 */
@Service
public class SeckillHallServiceImpl extends ServiceImpl<SeckillHallMapper, SeckillHall> implements SeckillHallService {

    @Override
    @Cacheable(value = CacheConstants.MALL_SECKILL_HALL, key = "#seckillHall.hallDate")
    public List<SeckillHall> list(SeckillHall seckillHall) {
        return baseMapper.selectList(Wrappers.query(seckillHall).orderByAsc("hall_time"));
    }
}
